#include <stdlib.h>
#include <stdio.h>
#include<string.h>

int reverse(int x)
{
    int sign = x >= 0 ? 1 : -1;
    char arr[11] = {0};
    itoa(sign * x, arr, 10);
    for (int i = 0, j = 11, temp; i < j; i++, j--)
    {
        /* code */
        temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }
    return sign * atoi(arr);
}

int main()
{
    int x;
    scanf("%d", &x);
    x = reverse(x);
    printf("%d",x);
    return 0;
}
